/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package restaurante.sessionbeans;

import java.util.List;
import javax.ejb.Stateful;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import restaurante.entidades.Mesa;

/**
 *
 * @author omar
 */
@Stateful
public class MesaFacade extends AbstractFacade<Mesa> implements MesaFacadeLocal {
    @PersistenceContext(unitName = "RestauranteEJB-ejbPU")
    private EntityManager em;
    private Query qry;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public MesaFacade() {
        super(Mesa.class);
    }
    public List<Mesa> getMesasParaMozo(){
        qry=em.createQuery("SELECT * FROM pedido WHERE fecha = CURRENT_DATE");
        return (List<Mesa>)qry.getResultList();
    }
    
}
